package main

import "fmt"

func main(){
	fmt.Println(isInterleave("aabcc", "dbbca", "aadbbcbcac"))
}

func isInterleave(s1 string, s2 string, s3 string) bool {
	idS1, idS2 := 0,0
	if len(s1) + len(s2) != len(s3) {
		return false
	}
	for _,v := range []byte(s3) {
		if idS1 < len(s1) && s1[idS1] == v{
			idS1++
		} else if idS2 < len(s2) && s2[idS2] == v {
			idS2++
		} else{
			return false
		}
	}
	return true
}

func